home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Dmod / dmod_P96 / modules / libraries / picasso96.m < prev   
Encoding:
Text File  |  2002-10-28  |  13.0 KB  |  322 lines

  1. /*  Picasso96.h -- include File
  2.  *  (C) Copyright 1996-98 Alexander Kneer & Tobias Abt
  3.  *  All Rights Reserved.
  4.  */
  5. /************************************************************************/
  6. /* includes
  7.  */
  8. MODULE    'exec/nodes',
  9.             'utility/tagitem'
  10.  
  11. /************************************************************************/
  12. /* This is the name of the library
  13.  */
  14. #define P96NAME  'Picasso96API.library'
  15.  
  16. /************************************************************************/
  17. /* Types for RGBFormat used
  18.  */
  19. FLAG    RGBF_NONE,                /* no valid RGB format (should not happen) */
  20.         RGBF_CLUT,                /* palette mode, set colors when opening screen using
  21.                                         tags or use SetRGB32/LoadRGB32(...) */
  22.         RGBF_R8G8B8,            /* TrueColor RGB (8 bit each) */
  23.         RGBF_B8G8R8,            /* TrueColor BGR (8 bit each) */
  24.         RGBF_R5G6B5PC,            /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
  25.                                         format: gggbbbbbrrrrrggg */
  26.         RGBF_R5G5B5PC,            /* HiColor15 (5 bit each), format: gggbbbbb0rrrrrgg */
  27.         RGBF_A8R8G8B8,            /* 4 Byte TrueColor ARGB (A unused alpha channel) */
  28.         RGBF_A8B8G8R8,            /* 4 Byte TrueColor ABGR (A unused alpha channel) */
  29.         RGBF_R8G8B8A8,            /* 4 Byte TrueColor RGBA (A unused alpha channel) */
  30.         RGBF_B8G8R8A8,            /* 4 Byte TrueColor BGRA (A unused alpha channel) */
  31.         RGBF_R5G6B5,            /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
  32.                                         format: rrrrrggggggbbbbb */
  33.         RGBF_R5G5B5,            /* HiColor15 (5 bit each), format: 0rrrrrgggggbbbbb */
  34.         RGBF_B5G6R5PC,            /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
  35.                                         format: gggrrrrrbbbbbggg */
  36.         RGBF_B5G5R5PC,            /* HiColor15 (5 bit each), format: gggrrrrr0bbbbbbgg */
  37.     
  38.         /* By now, the following formats are for use with a hardware window only
  39.             (bitmap operations may be implemented incompletely) */
  40.     
  41.         RGBF_Y4U2V2,            /* 2 Byte TrueColor YUV (CCIR recommendation CCIR601).
  42.                                         Each two-pixel unit is stored as one longword
  43.                                         containing luminance (Y) for each of the two pixels,
  44.                                         and chrominance (U,V) for alternate pixels.
  45.                                         The missing chrominance values are generated by
  46.                                         interpolation. (Y1-U0-Y0-V0) */
  47.         RGBF_Y4U1V1,            /* 1 Byte TrueColor ACCUPAK. Four adjacent pixels form
  48.                                         a packet of 5 bits Y (luminance) each pixel and 6 bits
  49.                                         U and V (chrominance) shared by the four pixels */
  50.         RGBF_MaxFormats
  51.  
  52. CONST    RGBFF_HICOLOR=RGBFF_R5G6B5PC|RGBFF_R5G5B5PC|RGBFF_R5G6B5|RGBFF_R5G5B5|RGBFF_B5G6R5PC|RGBFF_B5G5R5PC,
  53.         RGBFF_TRUECOLOR=RGBFF_R8G8B8|RGBFF_B8G8R8,
  54.         RGBFF_TRUEALPHA=RGBFF_A8R8G8B8|RGBFF_A8B8G8R8|RGBFF_R8G8B8A8|RGBFF_B8G8R8A8
  55.  
  56. /************************************************************************/
  57. /* Flags for p96AllocBitMap
  58.  */
  59. CONST    BMF_USERPRIVATE=$8000    /* private user bitmap that will never
  60.     be put to a board, but may be used as a temporary render buffer and accessed
  61.     with OS blit functions, too. Bitmaps allocated with this flag do not need to
  62.     be locked. */
  63.  
  64. /************************************************************************/
  65. /* Attributes for p96GetBitMapAttr
  66.  */
  67. ENUM    P96BMA_WIDTH,
  68.         P96BMA_HEIGHT,
  69.         P96BMA_DEPTH,
  70.         P96BMA_MEMORY,
  71.         P96BMA_BYTESPERROW,
  72.         P96BMA_BYTESPERPIXEL,
  73.         P96BMA_BITSPERPIXEL,
  74.         P96BMA_RGBFORMAT,
  75.         P96BMA_ISP96,
  76.         P96BMA_ISONBOARD,
  77.         P96BMA_BOARDMEMBASE,
  78.         P96BMA_BOARDIOBASE,
  79.         P96BMA_BOARDMEMIOBASE
  80.  
  81. /************************************************************************/
  82. /* Attributes for p96GetModeIDAttr
  83.  */
  84. ENUM    P96IDA_WIDTH,
  85.         P96IDA_HEIGHT,
  86.         P96IDA_DEPTH,
  87.         P96IDA_BYTESPERPIXEL,
  88.         P96IDA_BITSPERPIXEL,
  89.         P96IDA_RGBFORMAT,
  90.         P96IDA_ISP96,
  91.         P96IDA_BOARDNUMBER,
  92.         P96IDA_STDBYTESPERROW,
  93.         P96IDA_BOARDNAME,
  94.         P96IDA_COMPATIBLEFORMATS,
  95.         P96IDA_VIDEOCOMPATIBLE,
  96.         P96IDA_PABLOIVCOMPATIBLE,
  97.         P96IDA_PALOMAIVCOMPATIBLE
  98.  
  99. /************************************************************************/
  100. /* Tags for p96BestModeIDTagList
  101.  */
  102. CONST    P96BIDTAG_Dummy                         =TAG_USER + 96,
  103.         P96BIDTAG_FormatsAllowed             =P96BIDTAG_Dummy + $0001,
  104.         P96BIDTAG_FormatsForbidden         =P96BIDTAG_Dummy + $0002,
  105.         P96BIDTAG_NominalWidth                 =P96BIDTAG_Dummy + $0003,
  106.         P96BIDTAG_NominalHeight             =P96BIDTAG_Dummy + $0004,
  107.         P96BIDTAG_Depth                         =P96BIDTAG_Dummy + $0005,
  108.         P96BIDTAG_VideoCompatible             =P96BIDTAG_Dummy + $0006,
  109.         P96BIDTAG_PabloIVCompatible         =P96BIDTAG_Dummy + $0007,
  110.         P96BIDTAG_PalomaIVCompatible         =P96BIDTAG_Dummy + $0008
  111.  
  112. /************************************************************************/
  113. /* Tags for p96RequestModeIDTagList
  114.  */
  115. CONST    P96MA_Dummy                         =TAG_USER + $10000 + 96,
  116.         P96MA_MinWidth                     =P96MA_Dummy + $0001,
  117.         P96MA_MinHeight                     =P96MA_Dummy + $0002,
  118.         P96MA_MinDepth                     =P96MA_Dummy + $0003,
  119.         P96MA_MaxWidth                     =P96MA_Dummy + $0004,
  120.         P96MA_MaxHeight                     =P96MA_Dummy + $0005,
  121.         P96MA_MaxDepth                     =P96MA_Dummy + $0006,
  122.         P96MA_DisplayID                     =P96MA_Dummy + $0007,
  123.         P96MA_FormatsAllowed             =P96MA_Dummy + $0008,
  124.         P96MA_FormatsForbidden             =P96MA_Dummy + $0009,
  125.         P96MA_WindowTitle                 =P96MA_Dummy + $000a,
  126.         P96MA_OKText                         =P96MA_Dummy + $000b,
  127.         P96MA_CancelText                     =P96MA_Dummy + $000c,
  128.         P96MA_Window                         =P96MA_Dummy + $000d,
  129.         P96MA_PubScreenName                 =P96MA_Dummy + $000e,
  130.         P96MA_Screen                         =P96MA_Dummy + $000f,
  131.         P96MA_VideoCompatible             =P96MA_Dummy + $0010,
  132.         P96MA_PabloIVCompatible         =P96MA_Dummy + $0011,
  133.         P96MA_PalomaIVCompatible         =P96MA_Dummy + $0012
  134.  
  135. /************************************************************************/
  136. /* Tags for p96OpenScreenTagList
  137.  */
  138. CONST    P96SA_Dummy                         =TAG_USER + $20000 + 96,
  139.         P96SA_Left                             =P96SA_Dummy + $0001,
  140.         P96SA_Top                             =P96SA_Dummy + $0002,
  141.         P96SA_Width                         =P96SA_Dummy + $0003,
  142.         P96SA_Height                         =P96SA_Dummy + $0004,
  143.         P96SA_Depth                         =P96SA_Dummy + $0005,
  144.         P96SA_DetailPen                     =P96SA_Dummy + $0006,
  145.         P96SA_BlockPen                     =P96SA_Dummy + $0007,
  146.         P96SA_Title                         =P96SA_Dummy + $0008,
  147.         P96SA_Colors                         =P96SA_Dummy + $0009,
  148.         P96SA_ErrorCode                     =P96SA_Dummy + $000a,
  149.         P96SA_Font                             =P96SA_Dummy + $000b,
  150.         P96SA_SysFont                         =P96SA_Dummy + $000c,
  151.         P96SA_Type                             =P96SA_Dummy + $000d,
  152.         P96SA_BitMap                         =P96SA_Dummy + $000e,
  153.         P96SA_PubName                         =P96SA_Dummy + $000f,
  154.         P96SA_PubSig                         =P96SA_Dummy + $0010,
  155.         P96SA_PubTask                         =P96SA_Dummy + $0011,
  156.         P96SA_DisplayID                     =P96SA_Dummy + $0012,
  157.         P96SA_DClip                         =P96SA_Dummy + $0013,
  158.         P96SA_ShowTitle                     =P96SA_Dummy + $0014,
  159.         P96SA_Behind                         =P96SA_Dummy + $0015,
  160.         P96SA_Quiet                         =P96SA_Dummy + $0016,
  161.         P96SA_AutoScroll                     =P96SA_Dummy + $0017,
  162.         P96SA_Pens                             =P96SA_Dummy + $0018,
  163.         P96SA_SharePens                     =P96SA_Dummy + $0019,
  164.         P96SA_BackFill                     =P96SA_Dummy + $001a,
  165.         P96SA_Colors32                     =P96SA_Dummy + $001b,
  166.         P96SA_VideoControl                 =P96SA_Dummy + $001c,
  167.         P96SA_RGBFormat                     =P96SA_Dummy + $001d,
  168.         P96SA_NoSprite                     =P96SA_Dummy + $001e,
  169.         P96SA_NoMemory                     =P96SA_Dummy + $001f,
  170.         P96SA_RenderFunc                     =P96SA_Dummy + $0020,
  171.         P96SA_SaveFunc                     =P96SA_Dummy + $0021,
  172.         P96SA_UserData                     =P96SA_Dummy + $0022,
  173.         P96SA_Alignment                     =P96SA_Dummy + $0023,
  174.         P96SA_FixedScreen                 =P96SA_Dummy + $0024,
  175.         P96SA_Exclusive                     =P96SA_Dummy + $0025,
  176.         P96SA_ConstantBytesPerRow         =P96SA_Dummy + $0026
  177.  
  178. /************************************************************************/
  179. /* 
  180.  */
  181. CONST    MODENAMELENGTH=48
  182.  
  183. OBJECT P96Mode
  184.     Node:Node,
  185.     Description[MODENAMELENGTH]:UBYTE,
  186.     Width:UWORD,
  187.     Height:UWORD,
  188.     Depth:UWORD,
  189.     DisplayID:ULONG
  190.  
  191. /************************************************************************/
  192. /* Structure to describe graphics data
  193.  *
  194.  * short description of the entries:
  195.  * Memory:        pointer to graphics data
  196.  * BytesPerRow:   distance in bytes between one pixel and its neighbour up
  197.  *                or down.
  198.  * pad:           private, not used.
  199.  * RGBFormat:     RGBFormat of the data.
  200.  */
  201. OBJECT RenderInfo
  202.     Memory:PTR,
  203.     BytesPerRow:WORD,
  204.     pad:WORD,
  205.     RGBFormat:LONG
  206.  
  207. /************************************************************************/
  208. /* Structure for p96WriteTrueColorData() and p96ReadTrueColorData()
  209.  *
  210.  * short description of the entries:
  211.  * PixelDistance: distance in bytes between the red (must be the same as
  212.  *                for the green or blue) component of one pixel and its
  213.  *                next neighbour to the left or right.
  214.  * BytesPerRow:   distance in bytes between the red (must be the same as
  215.  *                for the green or blue) component of one pixel and its
  216.  *                next neighbour up or down.
  217.  * RedData:       pointer to the red component of the upper left pixel.
  218.  * GreenData, BlueData: the same as above.
  219.  *
  220.  * examples (for an array width of 640 pixels):
  221.  * a) separate arrays for each color:
  222.  *    { 1, 640, red, green, blue };
  223.  * b) plain 24 bit RGB data:
  224.  *    { 3, 640*3, array, array+1, array+2 };
  225.  * c) 24 bit data, arranged as ARGB:
  226.  *    { 4, 640*4, array+1, array+2, array+3 };
  227.  */
  228. OBJECT TrueColorInfo
  229.     PixelDistance:ULONG,
  230.     BytesPerRow:ULONG,
  231.     RedData:PTR TO UBYTE,
  232.     GreenData:PTR TO UBYTE,
  233.     BlueData:PTR TO UBYTE
  234.  
  235. /************************************************************************/
  236. /* Tags for PIPs
  237.  */
  238. CONST    P96PIP_Dummy             =TAG_USER + $30000 + 96,
  239.         P96PIP_SourceFormat     =P96PIP_Dummy+1,    /* RGBFTYPE (I) */
  240.         P96PIP_SourceBitMap     =P96PIP_Dummy+2,    /* struct BitMap * (G) */
  241.         P96PIP_SourceRPort     =P96PIP_Dummy+3,    /* struct RastPort * (G) */
  242.         P96PIP_SourceWidth     =P96PIP_Dummy+4,    /* ULONG (I) */
  243.         P96PIP_SourceHeight     =P96PIP_Dummy+5,    /* ULONG (I) */
  244.         P96PIP_Type             =P96PIP_Dummy+6,    /* ULONG (I) default: PIPT_MemoryWindow */
  245.         P96PIP_ErrorCode         =P96PIP_Dummy+7,    /* LONG* (I) */
  246.         P96PIP_Brightness     =P96PIP_Dummy+8,    /* ULONG (IGS) default: 0 */
  247.         P96PIP_Left             =P96PIP_Dummy+9,    /* ULONG (I) default: 0 */
  248.         P96PIP_Top                 =P96PIP_Dummy+10,    /* ULONG (I) default: 0 */
  249.         P96PIP_Width             =P96PIP_Dummy+11,    /* ULONG (I) default: inner width of window */
  250.         P96PIP_Height             =P96PIP_Dummy+12,    /* ULONG (I) default: inner height of window */
  251.         P96PIP_Relativity     =P96PIP_Dummy+13,    /* ULONG (I) default: PIPRel_Width|PIPRel_Height */
  252.         P96PIP_Colors             =P96PIP_Dummy+14,    /* struct ColorSpec * (IS)
  253.                                                              * ti_Data is an array of struct ColorSpec,
  254.                                                              * terminated by ColorIndex = -1.  Specifies
  255.                                                              * initial screen palette colors.
  256.                                                              * Also see P96PIP_Colors32.
  257.                                                              * This only works with CLUT PIPs on non-CLUT
  258.                                                              * screens. For CLUT PIPs on CLUT screens the
  259.                                                              * PIP colors share the screen palette.
  260.                                                              */
  261.         P96PIP_Colors32         =P96PIP_Dummy+15,    /* ULONG* (IS)
  262.                                                              * Tag to set the palette colors at 32 bits-per-gun.
  263.                                                              * ti_Data is a pointer * to a table to be passed to
  264.                                                              * the graphics.library/LoadRGB32() function.
  265.                                                              * This format supports both runs of color
  266.                                                              * registers and sparse registers.  See the
  267.                                                              * autodoc for that function for full details.
  268.                                                              * Any color set here has precedence over
  269.                                                              * the same register set by P96PIP_Colors.
  270.                                                              * This only works with CLUT PIPs on non-CLUT
  271.                                                              * screens. For CLUT PIPs on CLUT screens the
  272.                                                              * PIP colors share the screen palette.
  273.                                                              */
  274.         P96PIP_NoMemory                         =P96PIP_Dummy+16,
  275.         P96PIP_RenderFunc                     =P96PIP_Dummy+17,
  276.         P96PIP_SaveFunc                         =P96PIP_Dummy+18,
  277.         P96PIP_UserData                         =P96PIP_Dummy+19,
  278.         P96PIP_Alignment                         =P96PIP_Dummy+20,
  279.         P96PIP_ConstantBytesPerRow         =P96PIP_Dummy+21,
  280.         P96PIP_AllowCropping                 =P96PIP_Dummy+22,
  281.         P96PIP_InitialIntScaling             =P96PIP_Dummy+23
  282.  
  283. ENUM    PIPT_MemoryWindow,        /* default */
  284.         PIPT_VideoWindow,
  285.         PIPT_NUMTYPES
  286. CONST    P96PIPT_MemoryWindow     =PIPT_MemoryWindow,
  287.         P96PIPT_VideoWindow         =PIPT_VideoWindow
  288.  
  289. CONST    PIPRel_Right        =1,    /* P96PIP_Left is relative to the right side (negative value) */
  290.         PIPRel_Bottom        =2,    /* P96PIP_Top is relative to the bottom (negative value) */
  291.         PIPRel_Width        =4,    /* P96PIP_Width is amount of pixels not used by PIP at the
  292.                                            right side of the window (negative value) */
  293.         PIPRel_Height        =8        /* P96PIP_Height is amount of pixels not used by PIP at the
  294.                                            window bottom (negative value) */
  295. CONST    PIPERR_ATTACHFAIL     =2,    /* Failed to attach to a screen */
  296.         PIPERR_NOTAVAILABLE     =3,    /* PIP not available for other reason    */
  297.         PIPERR_OUTOFPENS         =4,    /* couldn't get a free pen for occlusion */
  298.         PIPERR_BADDIMENSIONS    =5,    /* type, width, height or format invalid */
  299.         PIPERR_NOWINDOW         =6,    /* couldn't open window */
  300.         PIPERR_BADALIGNMENT     =7,    /* specified alignment is not ok */
  301.         PIPERR_CROPPED         =8        /* pip would be cropped, but isn't allowed to */
  302.  
  303. /************************************************************************/
  304. /* Tags for P96GetRTGDataTagList
  305.  */
  306. CONST    P96RD_Dummy                         =TAG_USER + $40000 + 96,
  307.         P96RD_NumberOfBoards             =P96RD_Dummy+1
  308.  
  309. /************************************************************************/
  310. /* Tags for P96GetBoardDataTagList
  311.  */
  312. CONST    P96BD_Dummy                     =TAG_USER + $50000 + 96,
  313.         P96BD_BoardName                 =P96BD_Dummy+1,
  314.         P96BD_ChipName                 =P96BD_Dummy+2,
  315.         P96BD_TotalMemory             =P96BD_Dummy+4,
  316.         P96BD_FreeMemory                 =P96BD_Dummy+5,
  317.         P96BD_LargestFreeMemory     =P96BD_Dummy+6,
  318.         P96BD_MonitorSwitch             =P96BD_Dummy+7,
  319.         P96BD_RGBFormats                 =P96BD_Dummy+8,
  320.         P96BD_MemoryClock             =P96BD_Dummy+9
  321. /************************************************************************/
  322.